<%@page import="com.winexpress.account.Customer"%>
<%@page import="com.winexpress.util.SessionAttributes"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>wineXpress Admin Home</title>
 
    </head>
    <body>
       <t:adminNavigation/>

        <div class="header">
            <div class="logo_img"><img alt="Site Name" src="/WineXpressClient/resources/images/logo.png"></div>
        </div>

        <div class="panel panel-default" style="width:70%; margin-left: 15%; margin-top: 10px">
            <div class="panel-heading">
                <h3 class="panel-title">Customer Detail </h3>
            </div>

            <div class="panel-body">
                <div class="tab-content" style="margin-top: 2%">
                    <% Customer customer = (Customer) request.getAttribute("customer");
                        if (customer != null) {
                    %>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">User ID</label>
                        <div class="col-sm-10">
                            <p><%= customer.getId()%></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Email</label>
                        <div class="col-sm-10">
                            <p><%= customer.getEmail()%></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">First Name</label>
                        <div class="col-sm-10">
                            <p><%= customer.getFirstName()%></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Last Name</label>
                        <div class="col-sm-10">
                            <p><%= customer.getLastName()%></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Age</label>
                        <div class="col-sm-10">
                            <p><%= customer.getAge()%></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Phone Number</label>
                        <div class="col-sm-10">
                            <p><%= customer.getPhoneNumber()%></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Address</label>
                        <div class="col-sm-10">
                            <p><%= customer.getAddress()%></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm">Delete Customer Account</button>
                        </div>
                    </div>
                    <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
                        <div class="modal-dialog modal-sm">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title">Delete Customer</h4>
                                </div>
                                <div class="modal-body">
                                    <p>Delete customer <%= customer.getFirstName()%>?</p>
                                </div>
                                <div class="modal-footer">
                                    <table>
                                        <tr>
                                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                                        <form role="form" action="/WineXpressClient/accountManagement/deleteCustomerAccountResult" method="POST">
                                            <input type="hidden" name="customerID" value="<%= customer.getId()%>">
                                            <button type="Submit" class="btn btn-primary">Confirm</button>
                                        </form>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>

                    <%} else {%>
                    <div class="alert alert-danger">Cannot find customer</div>
                    <%}%>
                </div>

            </div>


        </div>
    </body>
</html>
